<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
  <head>
    <title>CsvUpload.html</title>
	
    <meta name="keywords" content="keyword1,keyword2,keyword3">
    <meta name="description" content="this is my page">
    <meta name="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->

  </head>
  <script type="text/javascript">
  function checkstring(obj){
  	var first=obj[0];
  	if(!( (first>='a'&&first<='z') || (first >='A'&&first <='Z') )){
  		return false;
  	}
  	return true;
  }
  function checkform(obj)
  {
  	with(obj){
  		if(!checkstring(obj.tablename.value)){
  			alert("表名首位应为字母");
  			return false;
  		}
  	}
  }
  </script>
  <body>
  	<a href="ExcelUpload.jsp">ExcelUpload</a>
    <h3>Csv File Upload:(post) action="UploadCsv"</h3>
	Select a file to upload: <br />
	<form method="post" enctype="multipart/form-data" action="UploadCsv" >
		<input type="file" name="file" size="50" /><br />
		tablename:<br />
		<input type="text" name="tablename" size =40/><br>
		创建人createuser：(默认admin)<br>
		<input type="text" name="createuser" size =40 /><br />
		编码charset:(默认iso-8859-1)<br>
		<input type="text" name="charset" size=40 /><br>
		审核人reviewer(不填=未审核)<br>
		<input type="text" name="reviewer" size=40 /><br>
		开放标志IsOpen (默认0)<br>
		<input type="text" name="IsOpen" size=40/><br>
		注释comment<br>
		<input type="text" name="comment" size=40/><br>
		<input type="submit" value="Upload File" />
	</form>
	<br>
	<h3>审核提交(get/post) action="ReviewTable"</h3>
	<form method="post" action="ReviewTable">
		tablename:<br />
		<input type="text" name="tablename" size=40/><br>
		审核人reviewer<br>
		<input type="text" name="reviewer" size=40 /><br>
		<input type="submit" value="submit" />
	</form>
	<br>
	<h3>Dat File Upload:(post) action="UploadLabDat"</h3>
	<h4>文件参考形式：<br>[Header]<br>......<br>[Data]<br>CSV数据</h4>
	Select a file to upload: <br />
	<form method="post" enctype="multipart/form-data" action="UploadLabDat" >
		<input type="file" name="file" size="50" /><br />
		tablename:<br />
		<input type="text" name="tablename" size =40/><br>
		创建人createuser：(默认admin)<br>
		<input type="text" name="createuser" size =40 /><br />
		编码charset:(默认iso-8859-1)<br>
		<input type="text" name="charset" size=40 /><br>
		审核人reviewer(不填=未审核)<br>
		<input type="text" name="reviewer" size=40 /><br>
		开放标志IsOpen (默认0)<br>
		<input type="text" name="IsOpen" size=40/><br>
		注释comment<br>
		<input type="text" name="comment" size=40/><br>
		<input type="submit" value="Upload File" />
	</form>
	<br>
	<div>
	返回事例(csv, dat，excel)<br>
	{"status":"0"} (successful)<br>
	{"status":"1","error":"there is no tablename!"}<br>
	{"status":"2","error":"table tablename has existed!"}<br>
	{"status":"3","error":"there is something wrong! maybe there is no file uploaded."}<br>
	{"status":"4","error":"there is something wrong!"} (other error)<br>
	{"status":"4","error":"there is something wrong when changing dat file to csv file!"}<br>
	</div>
	<div>
	返回事例(审核提交)<br>
	{"status":"0"} (successful)<br>
	{"status":"1","error":"update failed!"}<br>
	{"status":"2","error":"there is no tablename!"}<br>
	{"status":"3","error":"there is no reviewer!"}<br>
	{"status":"4","error":"there is something wrong!"}<br>
	
	</div>
	<div>
	<br>
	<h3>action="/DeleteDataTable"</h3>
	<strong>method=delete</strong><br>
	<strong>input objects:</strong><br>
	TableName 表名<br>
	OperateUser 操作员<br>
	NeedReserve 需要保留原数据吗？ false=不保留,true保留<br>
	
	返回事例<br>
	{"status":"0"}<br>
	{"status":"1","error":"wrong parameter!"}<br>
	{"status":"2","error":"database connection is something wrong!"}<br>
	{"status":"3","error":"no such table `TableName` in database!"}<br>
	</div>
	<br>
	<div>
	<h3>文献管理上传(POST/GET) action="/UploadLiterature"</h3>
	<form method="post" action="UploadLiterature" >
		LiteratureName 文献命名<br>
		<input type="text" name="LiteratureName" size=40/><br>
		CreateUser 创建者(默认admin)<br>
		<input type="text" name="CreateUser" size=40/><br>
		Reviewer  审核者 可空(不填=未审核)<br>
		<input type="text" name="Reviewer" size=40/><br>
		Title 文献标题 必填<br>
		<input type="text" name="Title" size=40/><br>
		Author 文献作者 必填<br>
		<input type="text" name="Author" size=40/><br>
		KeyWords 文献关键字 可空<br>
		<input type="text" name="KeyWords" size=40/><br>
		abstract 文献摘要 可空<br>
		<input type="text" name="abstract" size=40/><br>
		value 文献存放路径 可空<br>
		<input type="text" name="value" size=40/><br>
		IsOpen 开放标志 默认不开放 0=不开放 非0开放<br>
		<input type="text" name="IsOpen" size=40/><br>
		comment 注释 可空<br>
		<input type="text" name="comment" size=40/><br>
		<input type="submit" value="submit" />
	</form>
		
	</div>
	<div>
	<h3>修改文献审核 method="Put" action="/UploadLiterature"</h3>
	<strong>input:<br></strong>
	id 文献id号<br>
	Reviewer 审核人 <br>
	</div>
	
	<div>
	<h3>删除文献 method="Delete" action="/UploadLiterature"</h3>
	<strong>input:<br></strong>
	id 文献id号<br>
	OperateUser 操作人 默认admin <br>
	NeedReserve 删除标记 默认0=删除 非0=不删除<br>
	</div>
	<div>
	<h3>output事例:</h3>
	{"status":"0"}<br>
	{"status":"1","error":"wrong parameter!"}<br>
	{"status":"2","error":"database connection is something wrong!"}<br>
	{"status":"3","error":"there is no table named _literaturetable !"}<br>
	</div>
	
  </body>
</html>
